<?php
namespace Home\Controller;
class EmbodimentController extends HomeController {

    public function index(){
    	$banner = M("Ad")->where(array('id'=>7))->find();
        $this->assign('banner',$banner);

        $biaozhun = M('AlbumImage')->where('albumID=3')->select();
        $this->assign('biaozhun',$biaozhun);

        $zhuanli = M('AlbumImage')->where('albumID=2')->select();
        $this->assign('zhuanli',$zhuanli);

        $xijie = M('AlbumImage')->where('albumID=1')->select();
        $this->assign('xijie',$xijie);

        $cailiao = M('AlbumImage')->where('albumID=4')->select();
        $this->assign('cailiao',$cailiao);

        $baozhang = M('AlbumImage')->where('albumID=5')->select();
        $this->assign('baozhang',$baozhang);

        //工艺实录
        $map['cid'] = 18;
		$map['status'] = 1;
    	$map['del'] = 0; 
    	$map['picname'] = array('neq','');
		$gongyi = M('Article')->where($map)->order('sort asc,id desc')->limit(3)->select();
		$this->assign('gongyi',$gongyi);

		//实施保障
        $map['cid'] = 19;
		$map['status'] = 1;
    	$map['del'] = 0; 
    	$map['picname'] = array('neq','');
		$ssbz = M('Article')->where($map)->order('sort asc,id desc')->limit(3)->select();
		$this->assign('ssbz',$ssbz);
        $this->display();
    } 

    public function news(){
    	$cate = I('get.cate');
    	if ($cate!='' && is_numeric($cate)) {
    		$map['cid'] = $cate;
    		$map['status'] = 1;
        	$map['del'] = 0; 
        	$map['picname'] = array('neq','');
    		$list = M('Article')->where($map)->order('sort asc,id desc')->limit(4)->select();
    		$this->assign('list',$list);
    		$this->assign('cate',$cate);
    		echo $this->fetch();
    	}
    }
 
}